# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=xpl-search
pkgver=42.d4dbc97
pkgrel=2
groups=('blackarch' 'blackarch-exploitation' 'blackarch-misc')
pkgdesc='Search exploits in multiple exploit databases!.'
arch=('any')
url='https://github.com/CoderPirata/XPL-SEARCH'
license=('custom:unknown')
depends=('php' 'curl')
makedepends=('git')
source=("$pkgname::git+https://github.com/CoderPirata/XPL-SEARCH.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i '1 i\#!/usr/bin/env php' "xpl search.php"
}

package() {
  cd $pkgname

  install -Dm 755 "xpl search.php" "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
}

